<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .v-leave,
      .v-enter-to {
        
        opacity: 1;

      }
      .v-leave-active,
      .v-enter-active {
        transition: 2s all;
      }
      .v-leave-to,
      .v-enter {
        
        opacity: 0;
      }

      .move-leave-active {
        animation: move 2s linear;
      }
      .move-enter-active {
        animation: move 2s linear reverse;
      }

      @keyframes move {
        0% {
          opacity: 1;
        }
        50% {
          opacity: 1;
         
        }
        100% {
          opacity: 0;
          
        }
      }
      .demo{
        color: chartreuse;
        font-size: 40px;
      }
    </style>
  </head>

  <body>
    <div id="app">
      <button @click="ismove=!ismove">点我</button>
      <transition name="move">
        <p v-if="ismove" class="demo">忽隐忽现</p>
      </transition>
    </div>
    <script src="./js/vue.js"></script>
    <script>
      const vm = new Vue({
        data: {
          ismove: true,
        },
      });
      vm.$mount("#app");
    </script>
  </body>
</html>
